/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL.Utilities;

import SPARQL.SPARQL;
import java.util.Iterator;
import java.util.Set;

/**
 *
 * @author dimartinomirko
 */
public class SPARQLqueryTranslator {
    
    
    
   public String unionSetSparqlQueryBody(Set<SPARQL> querySet){
       
       if (querySet.size()==0) return " ";
       
       String string="{ ";
       
       Iterator<SPARQL> iterator = querySet.iterator();
        while(iterator.hasNext()){
            SPARQL query = iterator.next();
            string+= query.toString()+" }";
            if (iterator.hasNext())
            string+= " UNION { ";
            
        }
       
       
       
       
       
       
       return string;
   }
    
}
